﻿using SlamDunk.MES.IAppService.DTOs.Outputs.PlanContext;
using SlamDunk.MES.Presentation.Models.NotifyModels;

namespace SlamDunk.MES.Presentation.Maps
{
    /// <summary>
    /// 属性通知模型相关映射
    /// </summary>
    public static class NotifyMap
    {
        #region # 销售订单明细属性通知模型映射 —— static SaleOrderDetailNm ToNotifyView(this...
        /// <summary>
        /// 销售订单明细属性通知模型映射
        /// </summary>
        public static SaleOrderDetailNm ToNotifyView(this SaleOrderDetailInfo detailInfo)
        {
            SaleOrderDetailNm detailNm = new SaleOrderDetailNm
            {
                ProductId = detailInfo.ProductId,
                ProductNo = detailInfo.ProductInfo.Number,
                ProductName = detailInfo.ProductInfo.Name,
                Quantity = detailInfo.Quantity,
                Unit = detailInfo.ProductInfo.StandardUnitNo,
                ProductionBatchNo = detailInfo.ProductionBatchNo,
                Description = detailInfo.Description
            };

            return detailNm;
        }
        #endregion

        #region # 计划物料需求属性通知模型映射 —— static PlanMaterialAskNm ToNotifyView(this...
        /// <summary>
        /// 计划物料需求属性通知模型映射
        /// </summary>
        public static PlanMaterialAskNm ToNotifyView(this ProductionMaterialAskInfo materialAskInfo)
        {
            PlanMaterialAskNm materialAskNm = new PlanMaterialAskNm
            {
                MaterialId = materialAskInfo.MaterialInfo.Id,
                MaterialNo = materialAskInfo.MaterialInfo.Number,
                MaterialName = materialAskInfo.MaterialInfo.Name,
                Quantity = materialAskInfo.Quantity,
                Unit = materialAskInfo.MaterialInfo.StandardUnitNo
            };

            return materialAskNm;
        }
        #endregion

        #region # 计划物料需求属性通知模型映射 —— static PlanMaterialAskNm ToNotifyView(this...
        /// <summary>
        /// 计划物料需求属性通知模型映射
        /// </summary>
        public static PlanMaterialAskNm ToNotifyView(this ExecutionMaterialAskInfo materialAskInfo)
        {
            PlanMaterialAskNm materialAskNm = new PlanMaterialAskNm
            {
                MaterialId = materialAskInfo.MaterialInfo.Id,
                MaterialNo = materialAskInfo.MaterialInfo.Number,
                MaterialName = materialAskInfo.MaterialInfo.Name,
                Quantity = materialAskInfo.Quantity,
                Unit = materialAskInfo.MaterialInfo.StandardUnitNo
            };

            return materialAskNm;
        }
        #endregion
    }
}
